import request from '@/config/axios'
import type { Dayjs } from 'dayjs';

/** 班级每日交班信息 */
export interface ClassHandover {
          id: number; // 编号
          classId?: number; // 班级id
          mainTeacherId?: number; // 主班老师
          assistantTeacherId?: number; // 助教老师
          handoverTime?: string | Dayjs; // 交班时间
          childCount?: number; // 儿童数量
          remark: string; // 情况说明
          filesUrls: string; // 附件。交班时拍的照片或视频
  }

// 班级每日交班 API
export const ClassHandoverApi = {
  // 查询班级每日交班分页
  getClassHandoverPage: async (params: any) => {
    return await request.get({ url: `/school/class-handover/page`, params })
  },

  // 查询班级每日交班详情
  getClassHandover: async (id: number) => {
    return await request.get({ url: `/school/class-handover/get?id=` + id })
  },

  // 新增班级每日交班
  createClassHandover: async (data: ClassHandover) => {
    return await request.post({ url: `/school/class-handover/create`, data })
  },

  // 修改班级每日交班
  updateClassHandover: async (data: ClassHandover) => {
    return await request.put({ url: `/school/class-handover/update`, data })
  },

  // 删除班级每日交班
  deleteClassHandover: async (id: number) => {
    return await request.delete({ url: `/school/class-handover/delete?id=` + id })
  },

  /** 批量删除班级每日交班 */
  deleteClassHandoverList: async (ids: number[]) => {
    return await request.delete({ url: `/school/class-handover/delete-list?ids=${ids.join(',')}` })
  },

  // 导出班级每日交班 Excel
  exportClassHandover: async (params) => {
    return await request.download({ url: `/school/class-handover/export-excel`, params })
  },
}